home *** CD-ROM | disk | FTP | other *** search
- /*
- * $RCSfile: threadRestart.c,v $
- * $Revision: 1.2 $
- * $Date: 1996/05/04 23:51:55 $
- */
- /**********************************************************************
- * EXODUS Database Toolkit Software
- * Copyright (c) 1991 Computer Sciences Department, University of
- * Wisconsin -- Madison
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * THE COMPUTER SCIENCES DEPARTMENT OF THE UNIVERSITY OF WISCONSIN --
- * MADISON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION.
- * THE DEPARTMENT DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
- * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * The EXODUS Project Group requests users of this software to return
- * any improvements or extensions that they make to:
- *
- * EXODUS Project Group
- * c/o David J. DeWitt and Michael J. Carey
- * Computer Sciences Department
- * University of Wisconsin -- Madison
- * Madison, WI 53706
- *
- * or exodus@cs.wisc.edu
- *
- * In addition, the EXODUS Project Group requests that users grant the
- * Computer Sciences Department rights to redistribute these changes.
- **********************************************************************/
-
- #include "sysdefs.h"
- #include "ess.h"
- #include "checking.h"
- #include "trace.h"
- #include "error.h"
- #include "list.h"
- #include "tid.h"
- #include "io.h"
- #include "lock.h"
- #include "object.h"
- #include "msgdefs.h"
- #include "thread.h"
- #include "thread_funcs.h"
- #include "thread_globals.h"
-
-
- void
- threadRestart ()
-
- {
-
- #ifdef mips
- TRPRINT(TR_THREAD, TR_LEVEL_1, ("Restarting thread:%d SP:%x",
- Active->id, Active->initBuf[JB_SP]));
- #elif defined(sparc)
- TRPRINT(TR_THREAD, TR_LEVEL_1, ("Restarting thread:%d SP:%x",
- Active->id, Active->initBuf[JB_SP_SPARC]));
- #elif defined(linux)
- TRPRINT(TR_THREAD, TR_LEVEL_1, ("Restarting thread:%d SP:%x",
- Active->id, LINUX_JB_SP(Active->initBuf)));
- #elif defined(_AIX)
- TRPRINT(TR_THREAD, TR_LEVEL_1, ("Restarting thread:%d SP:%x",
- Active->id, Active->initBuf[JB_SP_AIX]));
- #elif defined(hpux)
- TRPRINT(TR_THREAD, TR_LEVEL_1, ("Restarting thread:%d SP:%x",
- Active->id, HPPA_JB_SP(Active->initBuf)));
- #elif !(defined(mips) || defined(sparc) || defined(_AIX) || defined(hpux) || defined(linux))
- not supported
- #else
- /* this else should have the not supported code, but the
- ultrix cpp is broken */
- #endif
-
- #ifdef DEBUG
- /* this thread should not hold any semaphores */
- /* We cannot have any SM_ASSERTs or SanityCheck()s
- * until the first longjmp
- * has been done, to get the system running on the
- * little stacks!
- */
- /* SM_ASSERT(LEVEL_3, Active->semCount == 0); */
- if( Active->semCount != 0) {
- SM_ERROR(TYPE_FATAL, esmASSERT);
- }
- #endif DEBUG
-
- reinitTcb(Active);
-
- /*
- * jump to the right place
- */
- longjmp(Active->initBuf, 0);
- }
-